#ifndef KEY_PROCESS_H
#define KEY_PROCESS_H

#include "config.h"

#define BACKSPACE 	127
#define TAB 		9
#define LF 			10
#define CR 			13
#define CTRL_KEY(k) ((k) & 0x1f)

/* ANSI escape code */
#define UP 			"\033[A"
#define DOWN 		"\033[B"
#define LEFT 		"\033[D"
#define RIGHT 		"\033[C"
#define CLS 		"\033[H\033[J" 	// clear screen
#define CLL 		"\033[2K" 		// clear current line
#define MOVE_CUR_BL "\033[0G" 		// move cursor to beginning of current line
#define HIDE_CUR 	"\033[?25l"
#define DISPLAY_CUR "\033[?25h"

int key_process(int c, char *buf, int *position, const char *_prompt, const char *_dir);

#endif
